import {
	Component
} from 'react';
import {
	Tab,
	Button,
	ScrollList,
	Group,
	Boxs,
	Avatar,
	Badge,
	Popup,
	ActionSheet,
	Dialog,
	Toast,
	Scroller,
	Grid,
} from 'saltui';
const {
	IconButton,
	ButtonGroup
} = Button;
const {
	HBox,
	Box
} = Boxs;

import PageController from 'pages/home';
import {
	urlPrefix,
	URLS,
	nodataIcon,
	dictMap
} from '../../../app/variables';
import Upload from 'components/upload';
import DB from '../../../app/db';
import './PageHome.less';

class ReplyComment extends Component {

	constructor(props) {
		super(props);
		var context = document.getElementById("context").value;
		this.state = {
			option: [],
			urlPrev: context + '/api/m/plugin/attachment/mobile/viewImage?fid=',
		}

		//this.photoTypeSuffixArray = ['.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG'];
		this.OPERATE = [{
			name: '删除',
			code: 'delete'
		}
		];
		
	}

	componentWillMount() {
		this.judgeOperate();
	}

	judgeOperate() {
		let option = this.generateIndependentOptions();
		let isModerator=this.props.isModerator;
		if (isModerator || this.props.isauthor == 1||this.props.isAdminRole) {
			this.pushInIndependentOptions(option, 'delete');
		}
		this.setState({
			option: option
		});
	}

	generateIndependentOptions() {
		return new Array();
	}

	pushInIndependentOptions(options, code) {

		if (options instanceof Array) {
			let n = this.acquireOptionWithName(code);
			options.push(n);
		}
		return options;
	}

	acquireOptionWithName(n) {
		let s;
		this.OPERATE.map((item, index) => {
			if (item.code == n) {
				s = item;
				return item;
			}
		});
		return s;
	}

	acquireIndependentOptionsName(options) {
		let names = [];
		if (options && options.length > 0) {
			options.map((item, index) => {
				names.push(item.name);
			});
		}
		return names;
	}

	handleOperateClick() {
	 	let t = this;
	// 	var check=this.state.post.checkStatus;
	// 	var isAuthor=this.state.post.isAuthor;
	// 	var isModerator=this.state.post.isModerator;
	// 	if(isModerator || (isAuthor && check == 0)){
		ActionSheet.show({
			options: t.acquireIndependentOptionsName(t.state.option),
			maskClosable: true,
		}, t.clickOperateItem.bind(t, t.state.option));
	}

	clickOperateItem(option, index) {
		if (index == -1) {
			return;
		}
		let opt = option[index];
		 if (opt.code == 'delete') {
			this.showConfirm(opt.code, '确定要删除吗？', {
				id: this.props.id
			});
		} else if (opt.code == 'edit') {
			location.hash = 'post/reply/' + this.props.isShowAnonymity + '/' + this.props.postId + '/' + this.props.boardId + '/' + this.props.id + '/undefined/' + this.props.author + '/' + this.props.checkStatus;
		}
	}

	showConfirm(optionCode, content, param) {
		Dialog.confirm({
			 title: '提示',
			// locale: 'en_US',
			content: content,
			onConfirm: this.confirmDialogButton.bind(this, optionCode, param),
			onCancel: (var1) => {
				console.log('confirm cancel');
			},
		});
	}

	confirmDialogButton(optionCode, argParam) {
		let t = this;
		if (optionCode == 'delete') {
			let param = {
				ids: argParam.id
			};
			DB.ForumModuleAPI.deletePost(param).then((content) => {
				Toast.show({
					type: 'success',
					content: '删除成功',
				});
			}).catch((error) => {
				Toast.show({
					type: 'error',
					content: error.errorMsg,
				});
			});			
		} else if (optionCode == 'check') {
			let param = {
				ids: argParam.id
			};
			DB.ForumModuleAPI.checkPost(param).then((content) => {
				Toast.show({
					type: 'success',
					content: '审核成功',
				});											
			}).catch((error) => {
				Toast.show({
					type: 'error',
					content: error.errorMsg,
				});
			});
		}
		setTimeout(function(){
			t.props.flushData();	
		}, 1500);
	}

	handleCheckClick(){
		this.showConfirm('check', '确定审核通过吗？', {
			id: this.props.id
		});
	}

	/**
	 * 点击评论回复图标的触发事件
	 * @param  {[type]}
	 * @return {[type]}
	 */
	handleClickReplyPost(item) {
		console.log(item.id);
		// alert(item.content);
		// window.salt.router.push({
		// 	id: 'replyOtherReply',
		// 	param: {
		// 		id: item.id,
		// 		content: item.content,
		// 	}
		// }).then(() => {
		// 	alert("push param success");
		// }).catch((e) => {
		// 	alert(JSON.stringify(e));
		// 	console.log(e);
		// });
		let url = 'post/reply/' + this.props.isShowAnonymity + '/' + this.props.postId + '/' + this.props.boardId + '/undefined/' + this.props.id + '/' + this.props.author + '/' + this.props.checkStatus;
		// this.props.router.push({
		// 	path: url,
		// 	query: {
		// 		name: ' sunny'
		// 	}
		// })

		// salt.router.postMessage({
		// 	key: 'sourceReplyContent',
		// 	value: item.content
		// });
		location.hash = url;
	}

	handleClickImage(imageId) {
		console.log(imageId);
	}
	/**
	 * 生成评论的HTML
	 * 
	 * @param  {[type]}
	 * @return {[type]}
	 */
	generateHtml(item) {
	
		var token = document.getElementById("token").value;
		var url=this.state.urlPrev;

		var imgUrl = '';
		if(this.props.image != null&&this.props.image != ''){
			imgUrl = url + item.image+'&token='+token;
		}
	
		let replyUserName = item.authorName.split('<');
		let checkStatus = this.props.checkStatus;
		let photo_html="";
		var createdDate = '';
		if(item.createdDate != undefined&&item.createdDate!='undefined'){
			createdDate = item.createdDate.substr(5,11);
		}
		let photosize = 0;	
		if (this.props.attIdJson && this.props.attIdJson.length > 0) {	
			photo_html = this.props.attIdJson.map((item, index) => {
				if ( photosize < 4) {
					var imageContent=url+item.id+'&token='+token;
					photosize++;
					return (
						<img width="80" height="80" src={imageContent}/>
					);
				}
			});
		}
		let is_moderator = false;
		if(this.props.isModerator || this.props.isauthor==1){
			is_moderator = true;
		}
		return (
			<Group.List lineIndent={50}>
		        <HBox vAlign="top" className=" t-PL16 t-PT30 t-BCf">
		            <Box className="t-PR16" style={{marginTop:'-6px'}}>
		            	{
	          				(imgUrl!=null&&imgUrl!='')?<Avatar src={imgUrl}/>: <Box  className="t-list-img t-WH30"> <Avatar name={replyUserName[0]}  size={28} style={{ fontSize:12}}/> </Box>
	         		 	}
	         		</Box>
		            <Box className="dd-bottom-border t-PR16">
		              <Box className="t-FC3">{item.authorName}</Box>

		              <HBox vAlign="center" className="t-FCddfontblue-40 t-PB10 t-FS12">
		                <Box className="t-MT6">
		                  {createdDate}
		              </Box>
		              </HBox>
		              <Box className="t-LH1_6 t-MB22">{item.content}</Box>
		            </Box>

		          </HBox>
			</Group.List>
		);

	}

	render() {

		return (
			<div>
				<Group>{this.generateHtml(this.props)}</Group>
			</div>
		);
	}

}

export default class PageHome extends Component {

	constructor(props) {
		super(props);
		//console.log(props);
		var context = document.getElementById("context").value;
		let winHeight = parseInt(getScrollHigh(0, 0, 0)) - 281 + 'px';
		let id = props.params.id;		
		let _isModerator = false;
		if(props.params.isModerator == 1){
			_isModerator = true;
		}
		let _isAuthor = false;
		if(props.params.isAuthor == 1){
			_isAuthor = true;
		}
		this.state = {
			winHeight: winHeight,
			postId: id,
			option: [],
			post: {
				post: [],
				replyCount: 0,
				isModerator:_isModerator,
				isAuthor:_isAuthor,
				checkStatus: 0,
				image:'',
				attIdJson:[],
				isShowAnonymity:0,
			},
			isCollection:false,
			replyArray: [],
			urlPrev: context + '/api/m/plugin/attachment/mobile/viewImage?fid=',
			dataGetted: false,
			hasError: false,
			pageSize: 10,
			currentPage: 0,
			totalElements:0,
			loading: false,
			refreshing: false,

		}
		//this.photoTypeSuffixArray = ['.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG'];
		this.OPERATE = [{
			name: '编辑',
			code: 'edit'
		}, {
			name: '删除',
			code: 'delete'
		}, {
			name: '引用',
			code: 'quote'
		}, {
			name: '回复',
			code: 'reply'
		}, {
			name: '审核',
			code: 'check'
		}
		];


		dd.biz.navigation.setTitle({
      		title: '详情',
		    onSuccess: function (result) {
		    },
     		 onFail: function () {
      		}
    		});

	}

	componentWillUnmount(){
		backPage();
	}
	handleClickImage(imageId) {
		console.log(imageId);
	}
	judgeOperate() {
		let option = this.generateIndependentOptions();
		var isAuthor=this.state.post.isAuthor;
		var isModerator=this.state.post.isModerator;
		var checkStatus=this.state.post.checkStatus;		
		//alert("isModerator:" + isModerator + ";isAuthor:" + isAuthor + ";checkStatus:" + checkStatus);
		// 根据每一项的信息判断是否显示options
		// 所有列表页面
		if(checkStatus == '1'){
			if (isModerator) {
				this.pushInIndependentOptions(option, 'check');
				this.pushInIndependentOptions(option, 'delete');
			}else if(isAuthor){
				this.pushInIndependentOptions(option, 'delete');
			}
		}else if(checkStatus == '2'||checkStatus== '4'){
			this.pushInIndependentOptions(option, 'reply');
			this.pushInIndependentOptions(option, 'quote');			
			if (isModerator) {				
				this.pushInIndependentOptions(option, 'edit');
				this.pushInIndependentOptions(option, 'delete');
			}else if(isAuthor){
				this.pushInIndependentOptions(option, 'edit');
				if(this.props.params.isCheck != 1){
					this.pushInIndependentOptions(option, 'delete');
				}				
			}
		}else if(checkStatus == '3'){
			this.pushInIndependentOptions(option, 'edit');
			this.pushInIndependentOptions(option, 'delete');
		}
		
		this.setState({
			option: option
		});
	}
/**
	 * 生成独立操作空间(数组)
	 * @return {[type]}
	 */
	generateIndependentOptions() {
		return new Array();
	}

	
	/**
	 * 获取操作改变
	 * @param  {[type]}
	 * @return {[type]}
	 */
	acquireOptionWithName(n) {
		let s;
		this.OPERATE.map((item, index) => {
			if (item.code == n) {
				s = item;
				return item;
			}
		});
		return s;
	}

	/**
	 * 获取独立空间中操作选项的名称
	 * @param  {[type]}
	 * @return {[type]}
	 */
	acquireIndependentOptionsName(options) {
		let names = [];
		if (options && options.length > 0) {
			options.map((item, index) => {
				names.push(item.name);
			});
		}
		return names;
	}

	/**
	 * 根据code获取操作放入独立空间
	 * 
	 * @param  {[type]}
	 * @param  {[type]}
	 * @return {[type]}
	 */
	pushInIndependentOptions(options, code) {
		if (options instanceof Array) {
			let n = this.acquireOptionWithName(code);
			options.push(n);
		}
		return options;
	}
	/**
	 * 帖子操作按钮的点击触发事件
	 *  所有帖子: 版主+管理员+本人 -- 编辑删除; 一般用户: 查看
	 *  我的发帖: 一般用户: 
	 * @return {[type]}
	 */
	handleOperateClick(e) {
		let t = this;
		// 显示下拉菜单
		ActionSheet.show({
			options: t.acquireIndependentOptionsName(t.state.option),
			maskClosable: true,
		},
		t.clickOperateItem.bind(t, t.state.option));
	}

	checkButtonClick(){
		this.showConfirm('check', '确定审核通过吗？', {
			id: this.state.postId
		});
	} 

	editButtonClick(){
		location.hash = 'post/edit/' + this.state.postId + '/' + this.state.post.checkStatus + '/' + this.state.post.author;
	} 

	deleteButtonClick(){
		this.showConfirm('delete', '确定要删除吗？', {
			id: this.state.postId
		});
	} 

	cancelButtonClick(){
		history.go(-1);
	}

	confirmDialogButton(optionCode, argParam) {
		if (optionCode == 'delete') {
			let param = {
				ids: argParam.id
			};
			DB.ForumModuleAPI.deletePost(param).then((content) => {
				Toast.show({
					type: 'success',
					content: '删除成功',
				});
				window.salt.router.goBack();
			}).catch((error) => {
				Toast.show({
					type: 'error',
					content: error.errorMsg,
				});
			});
		} else if (optionCode == 'check') {
			let param = {
				ids: argParam.id
			};
			DB.ForumModuleAPI.checkPost(param).then((content) => {
				Toast.show({
					type: 'success',
					content: '审核成功',
				});
				window.salt.router.goBack();
			}).catch((error) => {
				Toast.show({
					type: 'error',
					content: error.errorMsg,
				});
			});
		} 
	}

	/**
	 * 对每一个帖子的操作面板按钮的点击触发事件
	 * @param  {[type]}
	 * @param  {[type]}
	 * @return {[type]}
	 */
	clickOperateItem(option, index) {
		var postId=this.state.postId;
		if (index == -1) {
			return;
		}
		let opt = option[index];
		 if (opt.code == 'delete') {
			this.showConfirm(opt.code, '确定要删除吗？', {
				id: postId
			});
		} else if (opt.code == 'edit') {
			location.hash = 'post/edit/' + postId + '/' + this.state.post.checkStatus + '/' + this.state.post.author;
			
		} else if (opt.code == 'check') {
			this.showConfirm(opt.code, '确定审核通过吗？', {
				id: postId
			});
		}else if (opt.code == 'reply') {
			this.handleQuickReply();
		}else if (opt.code == 'quote') {
			location.hash = 'post/reply/' + this.state.post.isShowAnonymity + '/' + postId + '/' + this.state.post.boardId + '/undefined/' + this.state.post.id + '/' + this.state.post.author + '/' + this.state.post.checkStatus;
		}
	}

/**
	 * 操作面板点击后页面显示操作确认框
	 * @param  {[type]}
	 * @param  {[type]}
	 * @param  {[type]}
	 * @return {[type]}
	 */
	showConfirm(optionCode, content, param) {
		Dialog.confirm({
			title: '提示',
			content: content,
			onConfirm: this.confirmDialogButton.bind(this, optionCode, param),
			onCancel: (var1) => {
				console.log('confirm cancel');
			},
		});
	}

	/**
	 * 分页获取页面数据
	 * @param  {[type]}
	 * @param  {[type]}
	 * @param  {[type]}	成功的回调函数
	 * @param  {[type]} 失败的callback
	 * @return {[type]}
	 */
	viewPost(currentPage, pageSize, successCallback, errorCallBack) {
		let param = {
			id: this.state.postId,
			checkStatus: this.props.params.checkStatus,
			page: currentPage,
			rows: pageSize,
			limit: pageSize,
			start: (currentPage - 1) * pageSize,
		};
		DB.ForumModuleAPI.viewPost(param).then((content) => {
			//debugger;
			let page = content.page;
			let noMore = (page.totalPages > page.currentPage) ? false : true;
			successCallback(noMore, content);
		}).catch((error) => {
			errorCallBack();
		});
	}

	/**
	 * ScrollList 刷新函数
	 * @return {[type]}
	 */
	onRefresh() {
		this.setState({
			refreshing: true
		});
		this.viewPost(1, this.state.pageSize, (noMore, content) => {
			this.setState({
				refreshing: false,
				isCollection:content.isCollection,
				dataGetted: true,
				replyArray: content.page.content,
				totalElements:content.page.totalElements,
				currentPage: 1,
				noMore: noMore,
				hasError: false,
			});
		}, () => {
			this.setState({
				refreshing: false,
				dataGetted: true,
				noMore: noMore,
				hasError: true,
			});
		});
		Toast.hide();
	}

	/**
	 * ScrollList 正在加载函数
	 * @return {[type]}
	 */
	onLoad() {
		this.setState({
			loading: true
		});
		const curr = this.state.currentPage;

		this.viewPost(curr + 1, this.state.pageSize, (noMore, content) => {
			
			//console.log(this.state);
			this.setState({
				postId:content.post.recordId,
				isCollection:content.isCollection,
				post: content.post,
				replyArray: this.state.replyArray.concat(content.page.content),
				loading: false,
				dataGetted: true,
				currentPage: curr + 1,
				totalElements:content.page.totalElements,
				noMore:noMore,
				hasError: false,
			},()=>{
				this.judgeOperate();
				//this.refs.upload.initData();
			});
		}, () => {
			this.setState({
				loading: false,
				dataGetted: true,
				noMore: noMore,
				hasError: true,
			});			
		});

	}

	replyPost(){
		var content = $("#replyMessage").val();
		if(content==undefined || content.replace(/\s+/g,"")==""){
	        Toast.show({
	          type: 'error',
	          content: '内容不能为空',
	          onHide: function () {}
	        });
	        return false;
	      }
		if(content!=undefined || content!=""){
	      if(isEmojiCharacter(content)){
	        Toast.show({
		        type: 'error',
		        content: '内容不能输入表情',
		        onHide: function () {}
	     	});
	      	return false;
	      }
	    }
		var entity = {
			id:"",
			postId: this.state.postId,
			author: this.state.post.author,
			boardId: this.props.boardId,
			attId: "",
			content: content,
			type: '2',
			isAnonymity:this.state.post.isAnonymity,
		};
		let param = {
			id: this.state.postId
		}
		var attInfo = {};
		DB.ForumModuleAPI.replyPost({
			entity: JSON.stringify(entity),
			attInfo: attInfo
		}).then((content) => {
				Toast.show({
					type: 'success',
					content: '回帖成功',
				});
				$("#replyMessage").val("");
				this.refs.forum_view_ref.fetchData(param);
			}).catch((error) => {
				Toast.show({
					type: 'error',
					content: error.errorMsg,
				});
			});
	}
	
	flushViewData(){
		let param = {
			id: this.state.postId
		}
		DB.ForumModuleAPI.queryReplyCount(param).then((content) => {
			let post = this.state.post;
			post.replyCount = content;
			this.setState({
				post
			});
		}).catch((error) => {
			errorCallBack();
		});
		this.refs.forum_view_ref.fetchData(param);
	}

	handleQuickReply() {
		if(this.state.post.id==undefined || this.state.post.id==""){
        Toast.show({
          type: 'error',
          content: '操作过于频繁，请稍后进行回复!',
          onHide: function () {}
        });
        return false;
      }
     
	location.href = '#/post/reply/' + this.state.post.isShowAnonymity + '/' + this.state.post.id + '/' + this.state.post.boradId;
	}

	handleClick() {
    if (this.state.isCollection == true) {
      this.setState({
        isCollection: false
      })
    } else {
      this.setState({
        isCollection: true
      })
    }
  }

	render() {
		var token = document.getElementById("token").value;
		var url=this.state.urlPrev;
		let t = this;
		var isTop=this.state.post.isTop;
		var publishTime = '';
		if(this.state.post.publishTime != undefined&&this.state.post.publishTime!='undefined'){
			publishTime = this.state.post.publishTime.substr(5,11);
		}
		var picUrl = "";
		let labels_html;
		if (this.state.post.labels && this.state.post.labels.length > 0) {
			labels_html = this.state.post.labels.map((item, index) => {
				var labelColor = "t-tag-"+item.color+" t-MR4";
				var labelName = item.name;
				return (<Box className={labelColor}>{labelName}</Box>);
			});
		}
		var photosize = 0;
		var photo_html;
		if (this.state.post.attIdJson!=null && this.state.post.attIdJson.length > 0) {	
			photo_html = this.state.post.attIdJson.map((item, index) => {
					picUrl = url + item.id+'&token='+token;
					photosize++;
					return(
						<Box flex={1} className="t-OFH t-P2" style={{width:"100%",height:"200"}}>
	                      <img className="t-R4" src={picUrl} style={{ width: "100%", height: "100%" }}  />
	                    </Box>
                	);
			});
		}
		var imgUrl = '';
		if(this.state.post.image != null&&this.state.post.image != ''){
			imgUrl = url + this.state.post.image+'&token='+token;
		}

		let authorName = this.state.post.authorName;
		if(this.state.post.isAnonymity == 1 && authorName != '匿名' && authorName != null && authorName != 'undefined' && authorName != ''){
			authorName = authorName.substring(0, authorName.indexOf('<'));
		}

		let _checkStatus = this.state.post.checkStatus;
		let heightStyle = {height:"58px"};
		if(_checkStatus == '1'){
			heightStyle.height = "45px";
		}
		
		var isModerator=this.state.post.isModerator;
		let checkButton = 0;
		let deleteButton = 0;
		if(isModerator){
			checkButton = 1; deleteButton = 1;
		}
		let winHeightStyle = {
			height: this.state.winHeight
		};
		return (
			<div>

			<div className="t-BCf" >
				<Box className="t-BCf t-PL16 t-PR16 t-PB28">
		            <Box className="t-FS16 t-PT22 t-LH1_6 ">{this.state.post.title}</Box>
		            <HBox vAlign="center" className="t-FCddfontblue-40 t-PB24 t-FS12">
		              	<Box flex={1} className="t-FS14 t-PT12 t-FCddfontblue-60">
		                	{this.state.post.boardName}
		              		{
								isTop==1?
								<Box className="t-tag-red t-MR4">置顶</Box>:''
					        }
			          		{labels_html}
		              	</Box>
		              	<HBox vAlign="center" className="t-PT8 t-PR10">
			                <Box className="iconfont icon-messages t-FS14 t-MR4"></Box>
			                <Box className="t-MR10 t-FS14">{this.state.post.replyCount == null ? '0' : this.state.post.replyCount}</Box>
			                <Box className="iconfont icon-eye t-FS14 t-MR4"></Box>
			                <Box className="t-FS14">{this.state.post.viewCount == null ? '0' : this.state.post.viewCount}</Box>
			            </HBox>

		            </HBox>
					<Box className="t-PR10 t-FL" style={{marginTop:'-6px'}}>{
			          	(imgUrl!=null&&imgUrl!='')?<Avatar src={imgUrl}/>:<Avatar name={this.state.post.authorName} size={40}/>
			               }
			        </Box>
		            <Box className="t-FC3 t-omit">{this.state.post.authorName}</Box>
		            <Box className="t-MT6 t-FCddfontblue-40 t-FS12 t-MB20">{publishTime}</Box>
		       		<div style={{clear:"both"}}></div>
		            <Box className="t-FS16  t-LH1_6 t-MB20 t-ML4 t-MT10">
		            <span style={{paddingLeft:'32'}}></span>{this.state.post.content}</Box>
		            {photo_html}
	          </Box>
	        </div>

	        {
	        	this.state.post.checkStatus != '1'?
	        	<div>
	        	<div className="t-H10 t-BCf7"></div>
	        	{
	        		this.state.totalElements>0?
	        		<div>
		        		<div className="t-PL16 t-BCf t-PR16 t-LH2 t-PT6 t-PB6">评论({this.state.totalElements})</div>
		        		<div style={winHeightStyle}>
							<ScrollList
							  dataGetted={this.state.dataGetted}
					          data={this.state.replyArray}
					          hasError={this.state.hasError}
					          refreshing={this.state.refreshing}
					          onRefresh={this.onRefresh.bind(this)}
					          loading={this.state.loading}
					          onLoad={this.onLoad.bind(this)}
					          noMore={this.state.noMore}
					          noDataImage={nodataIcon}
					          ref='forum_view_ref'
							>
				        	<ReplyComment flushData={this.flushViewData.bind(this)} isModerator={this.state.post.isModerator} isShowAnonymity={this.state.post.isShowAnonymity}/>	        
			        		</ScrollList>
		        		</div>
	        		</div>
	        		:
	        		<div>
					<Box className="t-PL16 t-PR16 t-PT14 t-PB14 t-BCf t-FAC t-FCddfontblue-60">暂无评论</Box>
					<div style={winHeightStyle} style={{display:'none'}}>
							<ScrollList
							  dataGetted={this.state.dataGetted}
					          data={this.state.replyArray}
					          hasError={this.state.hasError}
					          refreshing={this.state.refreshing}
					          onRefresh={this.onRefresh.bind(this)}
					          loading={this.state.loading}
					          onLoad={this.onLoad.bind(this)}
					          noMore={this.state.noMore}
					          noDataImage={nodataIcon}
					          ref='forum_view_ref'
							>
				        	<ReplyComment flushData={this.flushViewData.bind(this)} isFloor={false} isModerator={this.state.post.isModerator} isShowAnonymity={this.state.post.isShowAnonymity}/>	        
			        		</ScrollList>
		        		</div>
	        		</div>
	        	}
	        	

	        	<div style={heightStyle}></div>
	          	<div className={(_checkStatus == '2'||_checkStatus=='4')&&this.state.post.isAuthor ? "apply-box t-FBH t-DN" : "t-DN"}>
	          		<HBox className="dd-top-border t-PL16 t-PR16 t-PT20 t-PB10 t-bottom-fixed t-BCf">
			             <input type="text" id="replyMessage"  flex={1} className="form-control" placeholder="说点什么吧..."></input>
			             <Button type="primary" size="small" display="inline" onClick={this.replyPost.bind(this)}>发送</Button>
			        </HBox>
	          	</div>
	          	<div className={(_checkStatus == '2'||_checkStatus=='4')&&!this.state.post.isAuthor ? "apply-box t-FBH t-DN" : "t-DN"}>
	          		<HBox className="dd-top-border t-PL16 t-PR16 t-PT20 t-PB20 t-bottom-fixed t-BCf">
			            <Box className="t-FS16 t-FC3" style={{width:'150',paddingLeft:'40',margin:'0 auto'}} onClick={this.handleQuickReply.bind(this)}>
			                <i className="iconfont icon-forum t-FS16 t-MR8 t-FCddfontblue-40" ></i>回复
			            </Box>
			            <Box className="t-FS16 t-FC3"style={{width:'150',paddingLeft:'50',margin:'0 auto'}}>
			              <i onClick={this.handleClick.bind(this)} className={t.state.isCollection?'iconfont icon-collect t-FS16 t-MR8 t-FCddfontblue-40 t-FCoranger':'iconfont icon-collect t-FS16 t-MR8 t-FCddfontblue-40'}></i>收藏
			             </Box>
			        </HBox>
	          	</div>
	          	</div>:""
	        }

	        {
	        	this.state.post.checkStatus == '1'?<div className="t-PL16 t-BCf t-PR16 t-LH2 t-PT6 t-PB6 dd-top-border" style={{textAlign:'center'}}>帖子审核中</div>:""
	        }

		</div>
		);
	}
}